From bdca0be97a2002ab89a606ece1e9da4648909339 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Fri, 30 Jan 2026 15:43:09 +0100 Subject: [PATCH] environment: Add fallback for MetaIdleMonitor::add_idle_watch_full() This function was only added in the 50 cycle and then backported to stable releases, so it might not exist in the version of mutter we are using. Part-of: --- js/ui/environment.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/ui/environment.js b/js/ui/environment.js index 93e0bdbd0..3ebe8e261 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -338,6 +338,20 @@ Clutter.Actor.prototype.toString = function () { return St.describe_actor(this); }; +if (!Meta.IdleMonitor.prototype.add_idle_watch_full) { + Meta.IdleMonitorWatchFlags = { + NONE: 0, + UNINHIBITABLE: 1, + START_NOW: 2, + }; + + Meta.IdleMonitor.prototype.add_idle_watch_full = function (interval, callback, flags = 0) { + if (flags !== 0) + console.warn('IdleMonitor does not support flags, the watch will not work as expected'); + this.add_idle_watch(interval, callback); + }; +} + Gio.File.prototype.touch_async = function (callback) { Shell.util_touch_file_async(this, callback); }; -- 2.39.5